Skip to content

feat(md): markdown-based memory store with db0 CLI#20

Open
lightcone0 wants to merge 11 commits intomainfrom
feat/db0-md-prototype
Open

feat(md): markdown-based memory store with db0 CLI#20
lightcone0 wants to merge 11 commits intomainfrom
feat/db0-md-prototype

Conversation

@lightcone0
Copy link
Copy Markdown
Contributor

Summary

  • New packages/md package (@db0-ai/db0) — a markdown-based memory store for AI agents
  • CLI binary: db0 with 5 commands: remember, search, pack, consolidate, index
  • Programmatic API via MemoryStore class with the same capabilities
  • Zero external dependencies beyond @db0-ai/core (uses hash embeddings, no API calls)
  • Files are the source of truth — ls memories/ tells you everything
  • Write-side primitives: scoping (user/agent/session/task), superseding, deduplication, expiration, context packing with token budgets

What's included

Area Details
Core MemoryStore, LocalContentStore, markdown parser/serializer, types
CLI 5 commands with --dir, --scope, --tags, --limit, --budget options
Tests 7 test files covering remember, search, pack, consolidate, markdown, content-store, index
Docs Design doc, implementation plan, package README, root README updated

Test plan

  • cd packages/md && npm test — all 7 test suites pass
  • npm run build — compiles cleanly
  • npx db0 — prints help
  • npx db0 remember "test fact" --dir /tmp/test-memories — creates file
  • npx db0 search "test" --dir /tmp/test-memories — finds result
  • npx db0 pack --dir /tmp/test-memories — outputs context block

🤖 Generated with Claude Code

lightcone0 and others added 11 commits April 3, 2026 14:41
Markdown-first CLI tool that turns a directory of markdown files into
a managed memory system with smart write (dedup + supersede), search,
context assembly, and garbage collection.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
7 tasks: package scaffolding, ContentStore, markdown parser,
MemoryStore engine, tests, CLI binary, and final integration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Core engine for the db0/md memory system. MemoryStore provides:
- remember(): smart write with threshold-based dedup/supersede
- search(): brute-force cosine similarity search via hashEmbed
- pack(): context assembly with token budget
- consolidate(): GC (archive superseded, expire old session/task, merge dupes)
- generateIndex(): generate MEMORIES.md grouped by scope

Includes tests for remember (4) and search (4), all passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…dex commands

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
MEMORIES.md is now auto-generated after every remember and consolidate
operation, matching the design spec.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
One brand, one command. Rename the CLI binary from mdcli to db0 and the
package from @db0-ai/mdcli to @db0-ai/db0. Add a comprehensive README
for the md package and list it in the root packages table.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant